<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Autosize</title>
<style type="text/css">

BODY { font-family: Arial; font-size: small;
background-color: #CCCCFF;}

A:hover {color: red; text-decoration: underline; }


</style>
<script 
src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA1DZDDhaKApTfIDHGfvo13hQHaMf-gMmgKgj1cacwLLvRJWUPcRTWzCG3PTSVLKG0PgyzHQthDg5BUw"type="text/javascript">
</script>
 <script type="text/javascript">
//<![CDATA[

function initialize() {
	////map
	var map = new GMap2(document.getElementById("map"));
	var start = new GLatLng(60.213,24.88);
	map.setCenter(start, 14);
	map.addControl(new GMapTypeControl(1));
	map.addControl(new GLargeMapControl());
	map.addControl(new GScaleControl());
	map.enableContinuousZoom();
	map.enableDoubleClickZoom();
	var ovMap=new GOverviewMapControl();
	map.addControl(ovMap);
	var mini=ovMap.getOverviewMap();
	
	///check resize
	document.getElementById("map").style.top="20px";
//	document.getElementById("map").style.left="135px";
	mapLeft = document.getElementById("sidebar").clientWidth + 20;
//	alert(mapLeft)
	document.getElementById("map").style.left=mapLeft + "px";
//	alert(document.getElementById("map").style.left)

	if (window.attachEvent) { 
		setIEMapExtent(); //on initialize
		adjustFoot();
		window.attachEvent("onresize",function(){ //IE
			setIEMapExtent();
			adjustFoot();
		});
	} else {
  	document.getElementById("map").style.right="20px";
		document.getElementById("map").style.bottom = "38px"
	}
	window.addEventListener("resize", function() {adjustFoot()}, false);
		adjustFoot();
}

function adjustFoot() {
//	alert(document.documentElement.clientHeight-40);
	footTop = document.documentElement.clientHeight-40;
	document.getElementById("foot").style.top = footTop + "px";
}


function setIEMapExtent() {
	var hght=document.documentElement.clientHeight-58;
	document.getElementById("map").style.height=hght+"px";
	var width=document.documentElement.clientWidth-document.getElementById("sidebar").clientWidth-40;
	document.getElementById("map").style.width=width+"px";
}

//]]>

</script>
 
</head>
<body onload="initialize()" onunload="GUnload()">

<div id="sidebar" style=" padding: 5px 0; border: thin solid #000000; width:250px">
	br sdfg sfgw354gfh sdf <br/>
	br sdfg sfgw354gfh sdf <br/>
	br sdfg sfgw354gfh sdf <br/>
	br sdfg sfgw354gfh sdf <br/>
	br sdfg sfgw354gfh sdf <br/>
	br sdfg sfgw354gfh sdf <br/>
	br sdfg sfgw354gfh sdf <br/>
	br sdfg sfgw354gfh sdf <br/>
	br sdfg sfgw354gfh sdf <br/>
	br sdfg sfgw354gfh sdf <br/>
	br sdfg sfgw354gfh sdf <br/>
</div>
<div id="map" style="position: absolute; "></div>


<div id="foot" style="position:absolute; width:95%">
<hr/>Some Footer
</div>


</body>
</html>
